-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tweak timing information #7
base: master
Are you sure you want to change the base?
Conversation
when using fatal it wasn't appending a newline, so messages were confusing this fixes that. also, add millisecond-level timing for how long it takes us to respond to requests. The *data* is available in UnixNano() but it requires doing the subtraction somehow, and also misses some of the overhead as the 'received challenge' only triggers after we've processed some of the request.
also, add a log when the process starts
Thanks again, John. It looks like all of this functionality (I hand checked it) was included I made one very minor tweak, putting the timing information inside of Thanks! Dustin Kirkland On Wed, Feb 26, 2014 at 8:14 AM, John Arbash Meinel <
|
Yeah. I ended up having to merge them because they changed similar lines so Thanks for merging it. John
|
This adds a few small changes to the logging. It adds "in %.6fs" to the response message, which lets you see how long each request is served. You can almost extract that from the existing messages (with UnixNano), but it requires math, which is hard to do in a big log file.
Also, the Request is only after we've already done some checksumming of the user request, and I wanted that in the timing.
In running on my machine, most requests can be served in 50us or so, but occasionally you'll even get up to 180ms. I'm guessing those are times when the garbage collector kicked in.
On my machine (with 4 real cores) I get throttled at about 230% CPU, with rsyslog taking another 100%CPU, and I'm getting 500k requests served in 30s (16.6k reqs/second) (I tried it with big curl loops, and ab test gives similar results). 6ms average request response.
I have a profiling branch (not submitted here), which says that we're spending 33% of our time in Syscall trying to read network data (possibly also reading /dev/urandom?), 12% of the time doing Fprintf stuff (probably explains all the GC), and 15% of the time in syslog.Info, we actually spend only about 3% of the time doing actual sha 512 stuff. (If I disable syslog, I only get to 19k reqs/second, if I make the inner ServeHTTP a simple write data and return it is also 19k reqs/second so the rest of the overhead is in HTTP lib stuff.)
Anyway, this is a small tweak, if you like it.